<#import "/spring.ftl" as spring />

<#include "/tags/publicProfileHeader.ftl">
<#include "/tags/famousQuote.ftl">
<#include "/tags/userCompleteness.ftl">
<#include "/tags/userIntroTag.ftl">
<#include "/tags/friendList.ftl">
<#include "/tags/friendHintTag.ftl">
﻿<#include "/tags/goalProcessTag.ftl">
<#include "/tags/goalEntryTag.ftl">
<#include "/tags/goalCloudTag.ftl">
<#include "/tags/updatedSinceTag.ftl">
<#include "/tags/DDMMYYYY.ftl">
<#include "/tags/likeTag.ftl">
<#include "/tags/entryAvatar.ftl">
<#include "/tags/topGoalsTag.ftl">
<#include "/tags/commonGoalsTag.ftl">
<#include "/tags/confirmBox.ftl">
<#include "/tags/editEntryTag.ftl">
<#include "/tags/commentTag.ftl">
<#include "/tags/commentBoxTag.ftl">
<#include "/tags/userEntryTag.ftl">
<#include "/tags/userHowIDoneTag.ftl">
<#include "/tags/mutualFriendsTag.ftl">
<#include "/tags/activitiesTag.ftl">
<#include "/tags/tabTag.ftl">
<#include "/tags/publicInformationBoxTag.ftl">

<head>	     	
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/scripts/cleditor/jquery.cleditor.css">
	
	<script type="text/javascript" src="${rc.contextPath}/scripts/cleditor/jquery.cleditor.min.js"></script>
    <script type="text/javascript" src="${rc.contextPath}/scripts/page.publicProfile.js"></script>
	
	<link type="text/css" rel="stylesheet" href="${rc.contextPath}/styles/tools/jquery.autocomplete.css" /> 
	<script type="text/javascript" src="${rc.contextPath}/scripts/jquery.autocomplete.js"></script>
    
	<link rel="stylesheet" type="text/css" href="${rc.contextPath}/styles/style_dev.css">
	<title>Trang cá nhân của ${data.username}</title>
</head>

 <@publicProfileHeader data />  
  <div class="w3"></div>
  <div id="infomation">
  	<div id="left">
  		<#if data.firstName?? && data.firstName?has_content>
			<#assign name= data.firstName/>
		<#else>
			<#assign name= data.username/>
		</#if>
  		<@tab viewer=data.userInSession pageOwner=data.username pageOwnerName=name page="DASHBOARD" />
    	<div class="clearthis"></div>
    	<div class="dashboardBlueBox">
        	<div class="dbTitle" style="border:2px dotted #fff;padding:10px;width:96%">
            	<b style="font-size:14px;">"Ông chủ làm vẻ vang cho ngôi nhà chứ không phải ngôi nhà làm vẻ vang cho ông chủ - Ciceron"</b>
            </div>
        </div>
        <div class="clear"></div>

    	<@goalprocess showActionControl="no"/>
	    
	    <div class="w4"></div>
	   	<div id="entry_container">
	      	<#if data.recentEntries?exists>
			<div class="archtitle"><@spring.message "page.dashboard.recentEntry"/></div>
			<div class="w4"></div>
			<#list data.recentEntries as entry>
			<#if (entry.entryType==1)>		
			<!-- entry view -->
			<div id="entry_holder_${entry.id}">	      
		    	<@entryView entryId=entry.id goalId=entry.goalId goalTitle=entry.goalTitle 
		      		  youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount 
		      		  commentCount=entry.commentCount body=entry.body title=entry.title imgURL=entry.imgURL goalCreatedDate=entry.goalCreatedDate 
		      		  entryUpdatedSince=entry.updatedSince createdDate=entry.createdDate createdMonth=entry.createdMonth
		      		  createdYear=entry.createdYear ownerName=entry.ownerName comments=entry.comments/>		      		      	 
			</div>
			<!-- end of entry view -->
		    
			<#else>
		    	<div class="archicle">
					<@userHowIDone title=entry.title goalId=entry.goalId goalTitle=entry.goalTitle 
							   youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount
							   ownerName=entry.ownerName experience=entry.experience 
							   tookType=entry.tookType tookAmount=entry.tookAmount 
							   imgURL=entry.imgURL solution=entry.solution 
							   tip=entry.tip resources=entry.resources entryId=entry.id 
							   cheerCount=entry.cheerCount commentCount=entry.commentCount
							   createdDate=entry.createdDate createdMonth=entry.createdMonth 
							   createdYear=entry.createdYear ownerAvatar=entry.ownerAvatar 
							   entryUpdatedSince=entry.updatedSince comments=entry.comments goalCreatedDate=entry.goalCreatedDate/>					
				</div>	
			</#if>	
			<#assign lastItem=entry/>
			<div class="w4"></div>
			</#list>
			<#if lastItem?? && lastItem.ownerId??>
				<div id="next_page_scroll" class="userEntryView;${lastItem.ownerId};" rel="${lastItem.sortedValue}" style="float:left"></div>
				<div id="scroll_loader" style="display: none; width: 100%; float: left; padding-top: 30px;">
					<center>
					<img src="/images/loader.gif"/>
					</center>
				</div>
			</#if>
			</#if>      
		</div>     
		<#if (data.recentEntries?size == 0)>
			<div class="clear"></div>
            <div class="NoGoal">
            	<span class="icon_1 iconNoGoal"></span>
                <p>                	
                	Hiện tại ${data.username} <b>chưa viết</b> bất cứ bài viết nào.
                </p>
            </div>      		
      	</#if>
		<div class="w4"></div>
  	</div>
    
    <div id="right">
		<@publicInformationBox data />
		<@userIntro allowChange="no"/>
        <@mutualFriends />
        <@friendList username="${data.username}" />
	</div>
	
	<@confirmationBox />
  </div>